package com.xuelang.pipeline.app.task.converter;

import com.xuelang.pipeline.client.task.dto.TaskDefDTO;
import com.xuelang.pipeline.domain.task.TaskDef;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 流水线任务定义DTO与流水线任务定义实体转换器
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface TaskDefDTOToTaskDefConverter {
    TaskDefDTOToTaskDefConverter INSTANCE = Mappers.getMapper(TaskDefDTOToTaskDefConverter.class);

    /**
     * TaskDef转化为TaskDefDTO
     * @param taskDef
     * @return
     */
    TaskDefDTO taskDefToTaskDefDTO(TaskDef taskDef);

    /**
     * TaskDefDTO转化为TaskDef
     * @param taskDefDTO
     * @return
     */
    TaskDef taskDefDTOToTaskDef(TaskDefDTO taskDefDTO);
}
